{include file="public/public"}
<style type="text/css">
    #show tr td{
        overflow: hidden;
    }
    #show tr td p {
        width: 150px;
        float: left;
        text-align: center;
    }

</style>
<div class="layui-tab layui-tab-brief" lay-filter="demoTitle">
    <div class="layui-body layui-tab-content site-demo site-demo-body">
        <div class="layui-tab-item layui-show">
            <div class="layui-main">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 50px;"></fieldset>
                <span class="layui-breadcrumb">
                    <a href="__APP__/{$menuConfigArry['functionMod']}/{$menuConfigArry['menuLabel']}">{$menuConfigArry['pmenuName']}</a>
                    <a><cite>{$menuConfigArry['menuName']}</cite></a>
                </span>
                <hr>

                <table class="layui-table" lay-skin="line">
                    <thead>
                    <tr>
                        <td width="75">选择</td>
                        <td width="267">岗位名</td>
                        <td width="261">岗位编号</td>
                        <td width="261">需求人数</td>
                        <td width="261">性格特征</td>
                        <td width="261">性格编号</td>
                        <td width="180">操作</td>
                    </tr>
                    </thead>
                    <tbody>
                    <?
	                    if($Arr){
	                      	foreach($Arr as $val){
	                        $tmp = addslashes(json_encode($val));
	                     ?>
                    <tr>
                        <td><input type="checkbox" name="roombox" id="roombox" value="{$val[id]}"></td>
                        <td>{$val[postName]}</td>
                        <td>{$val[postCode]}</td>
                        <td>{$val[number]}</td>
                        <td>{$val[characterName]}</td>
                        <td>{$val[characterNo]}</td>
                        <td>
                            <a href="#" class="layui-btn layui-btn-sm" onclick='edit("{$tmp}",2)'>修改 </a>
                        </td>
                    </tr>
                    <?php
                        }
                    }
                ?>
                    </tbody>
                </table>
                <div>管理操作全选
                    <input type="checkbox" onClick="checkallstu(this)" />
                    <input name="submit" type="submit" value="删除" onclick="delall()" class="layui-btn layui-btn-sm layui-btn-warm" />
                    <input name="submit2" type="button" value="添加岗位" onclick="document.getElementById('show').style.display='block'" class="layui-btn layui-btn-sm" />
                </div>
                <div class="layui-box layui-laypage layui-laypage-default">{$page}</div>

                <FORM action="__APP__/admin/editPost" enctype="multipart/form-data" method="post">
                    <div id="show" style="display:none" class="show">
                        <table class="layui-table">
                            <colgroup>
                                <col width="400">
                                <col width="400">
                            </colgroup>
                            <thead>
                            <tr>
                                <td colspan="2">岗位信息</td>
                                <input type="hidden" id="id" name="id">
                            </tr>
                            </thead>
                            <tbody>

                            <tr class="ctt_gr">
                                <td align="left" class="leftClass">
                                    <p>岗位名：</p>
                                    <input class="textField_hp1" name="postName" lay-verify="title" autocomplete="off" class="" id="postName">
                                </td>
                                <td align="left">
                                    <p>性格特征：</p>
                                    <input class="textField_hp1" size="20" id="characterName" name="characterName" />
                                </td>
                            </tr>

                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>需求人数：</p>
                                    <input class="textField_hp1" size="20" id="number" name="number" />
                                </td>
                                <td align="left">
                                    <p>性格编号：</p>
                                    <input class="textField_hp1" size="20" id="characterNo" name="characterNo" />
                                </td>
                            </tr>
                            <tr class="ctt_gr">
                                <td align="left">
                                    <p>岗位编号：</p>
                                    <input class="textField_hp1" size="20" id="postCode" name="postCode" />
                                </td>

                                <td align="left">
                                    <p>量化分数：</p>
                                    <input class="textField_hp1" size="20" id="score" name="score" />
                                </td>
                            </tr>

                            <tr class="ctt_gr">
                                <td height="31" colspan="2" align="center">
                                    <input name="submit22" type="submit" value="确定" border="0" class="layui-btn" id="ok" />
                                    <input name="submit22" type="button" value="取消" border="0" onclick="document.getElementById('show').style.display='none'" class="layui-btn layui-btn-warm" />
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </FORM>
            </div>
        </div>
    </div>
</div>

<script language="javascript">

    function edit(val, flag) {
        var json = JSON.parse(val);
        $("#id").val(json.id);
        $("#postName").val(json.postName);
        $("#postCode").val(json.postCode);
        $("#number").val(json.number);
        $("#characterName").val(json.characterName);
        $("#characterNo").val(json.characterNo);
        $("#score").val(json.score);
        $("#show").show();
    }

    function delall() {
        var arr = "";
        $("input[name=roombox]:checked").each(function() {
            arr += $(this).val() + ",";
        })
        if(arr == "") {
            alert('请选择要删除的记录');
            return false;
        }
        if(confirm("您确定要删除吗？")) {
            $.post("__APP__/admin/delallPost", {
                arr: arr
            }, function(data) {
                if(data.msg == "1") {
                    alert("删除成功");
                    location.reload();
                } else {
                    alert("删除失败");
                }
            }, "json");
        } else {
            return false;
        }
    }

</script>

